import logCenter from '@/lib/router/module/logCenter';
import configuration from '@/lib/router/module/configuration';
import tenant from '@/lib/router/module/tenant';
import messageCenter from '@/lib/router/module/messageCenter';
import identity from '@/lib/router/module/identity';
import member from '@/lib/router/module/member';
import clubManagement from '@/lib/router/module/clubManagement';
import grade from '@/lib/router/module/grade';
import dataCenter from '@/lib/router/module/dataCenter';
import mall from '@/lib/router/module/mall';
import system from '@/lib/router/module/system';
import operation from '@/lib/router/module/operation';
import game from '@/lib/router/module/game';
import seq from '@/lib/router/module/seq';
import interaction from '@/lib/router/module/interaction';
import resource from '@/lib/router/module/resource';
import logistics from '@/lib/router/module/logistics';
import order from '@/lib/router/module/order';
import gateway from '@/lib/router/module/gateway';
import train from '@/lib/router/module/train';
import platformIntegral from '@/lib/router/module/platformIntegral';
// import insurance from '@/lib/router/module/insurance';
import popularity from '@/lib/router/module/popularity';
import duan from '@/lib/router/module/duan';
import membershipFee from '@/lib/router/module/membershipFee';
import wxApp from '@/lib/router/module/wxApp';

const baseRouter = [
  {
    path: '',
    component: () => import(/* webpackChunkName: "platform" */ '@/layout/platform'),
    redirect: { name: 'Dashboard' },
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import(/* webpackChunkName: "platform" */ '@/views/dashboard/index'),
      meta: { title: 'dashboard', code: 'Dashboard', icon: 'dashboard', affix: true, identity: [{ code: 'dashboardAdd', title: 'dashboardAdd' }] }
    }]
  },

  // 没有匹配跳转404
  { path: '*', redirect: '/404', hidden: true, meta: { code: 'Dashboard', deleteThis: true }}
];

export default [
  {
    path: '/:tenantId',
    name: 'baserouter',
    component: () => import(/* webpackChunkName: "platform" */ '@/views/index'),
    children: [
      ...baseRouter,
      ...identity,
      ...tenant,
      ...game,
      ...train,
      ...mall,
      ...gateway,
      ...member,
      ...messageCenter,
      ...logCenter,
      ...logistics,
      ...order,
      ...configuration,
      ...clubManagement,
      ...grade,
      ...dataCenter,
      ...system,
      ...operation,
      ...seq,
      ...interaction,
      ...resource,
      ...platformIntegral,
      // ...insurance,
      ...popularity,
      ...duan,
      ...membershipFee,
      ...wxApp
    ]
  }
];
